<script setup>
import { createBuryPoint } from '@/api/global'
import cookie from "@/utils/cookie";
import { onLaunch, onShow } from "@dcloudio/uni-app";
import { useMainStore } from "@/store/modules/useMainStore";

const mainStore = useMainStore();
onLaunch(() => {
  const tokenObj = cookie.get('accessToken')
  let userInfo = ''
  if (tokenObj && !mainStore.user) {
    userInfo = mainStore.getUserInfo()
  }
  // 埋点
  createBuryPoint({
    event: 'visit',
  })
})

onShow(() => {
  mainStore.doGetIntegralName()
})
</script>

<style lang="scss">
/*每个页面公共css */
@import '@/uni_modules/uv-ui-tools/index.scss';
@import "style/style.scss";

page {
  background-color: #f5f5f5;
  position: relative;
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);

  &::after {
    content: '';
    width: 100%;
    height: env(safe-area-inset-bottom);
    background: #f5f5f5;
  }

  &::before {
    content: '';
    width: 100%;
    height: env(safe-area-inset-bottom);
    background: #f5f5f5;
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 999;
  }
}
</style>
